import { reactive } from 'vue'
import axios from 'axios'

export default () => {
  let dogList = reactive([
    'https://images.dog.ceo/breeds/pembroke/n02113023_4726.jpg',
  ])
  async function getDog() {
    try {
      let res = await axios.get('https://dog.ceo/api/breeds/image/random')
      dogList.push(res.data.message)
    } catch (error) {
      alert(error)
    }
  }
  return { dogList, getDog }
}
